*Paper: Fiscal Rules, Corruption and Electoral Accountability - Replication Files

clear all
cap log close 
set more off


**Global files
global folder "/Users/tommasogiommoni/Dropbox/Determinants of corruption/Stability pact and corruption/Replication files JOP"


********************************************************************************
****----						Dataset open 					    	----**** 
********************************************************************************

use "$folder/Data/dataset_feb2024.dta", clear

**-- Global

global controls7 proportion_female_Elected_lag av_education_Elected_lag av_age_Elected_lag  victory_margin_lag term_limit_lag 
global controls7_int  c.proportion_female_Elected_lag##i.anno c.av_education_Elected_lag##i.anno c.av_age_Elected_lag##i.anno c.victory_margin_lag##i.anno  c.term_limit_lag##i.anno
global controls8_int  c.proportion_female_Elected_lag##i.anno c.av_age_Elected_lag##i.anno

**-- Panel dataset

xtset codcom anno
fvset base 2012 anno

********************************************************************************
****----						Analysis 					    		----**** 
********************************************************************************

qui reghdfe corruption_PC_sd S##T P i.region_year $controls7_int if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA") & anno>=2008, absorb(codcom) vce(cluster codcom)
est store tab1
qui reghdfe corruption_exp_log_sd S##T P i.region_year $controls7_int if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA") & anno>=2008, absorb(codcom) vce(cluster codcom)
est store tab2
qui reghdfe tot_revenues S##T P c.population_anagrafe_D##post_2012 i.region_year $controls7_int if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA") & anno>=2008, absorb(codcom) vce(cluster codcom)
est store tab3
qui reghdfe current_exp_PC S##T P i.region_year $controls7_int if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA") & anno>=2008, absorb(codcom) vce(cluster codcom)
est store tab4
qui reghdfe capital_ext_PC S##T P i.region_year $controls7_int if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA") & anno>=2008, absorb(codcom) vce(cluster codcom)
est store tab5
qui reghdfe procurement_amount_PC S##T P i.region_year $controls7_int if abs(P)<2500 & FURs==0 & (special_region==0 | regione=="SICILIA" | regione=="SARDEGNA") & anno>=2008, absorb(codcom) vce(cluster codcom)
est store tab6

esttab tab1 tab2 tab3 tab4 tab5 tab6 using "$folder/Tables/TableA9.tex", compress keep(1.S#1.T ) se r2 staraux collabels(, none) ml(,none) cells(b(star fmt (%9.3f)) se(par)) star(* 0.10 ** 0.05 *** 0.01) replace

